<template>
	<view class="indexcontent" >
		<Banner ></Banner>
		<Tab ></Tab>
		<Inform></Inform>
		<Exam></Exam>
		<Questionbank ></Questionbank>
		
		<!-- <Article ></Article> -->
		<Circle ></Circle>
		
	</view>
</template>

<script>
	import Banner from "../../components/index/banner.vue"
	import Tab  from "../../components/index/tab.vue"
	import Circle from  "../../components/index/circle.vue"
	import Article from "../../components/index/article.vue"
	import Questionbank from "../../components/index/questionbank.vue"
	import Exam from "../../components/index/exam.vue"
	import Inform  from "../../components/index/inform.vue"
	export default {
		components:{
			Banner,Tab,Circle,Article,Questionbank,Inform,Exam
		},
		data() {
			return {
				user_id : ''
			}
		},
		onLoad() {
			let that  =this;
			wx.login({
			    success(res) {
					console.log(res);
			        if (res.code) {
						that.$user.login({'code':res.code}).then(res=>{
							if(res.code == 1){
								uni.setStorageSync("user_id",res.data.user_id);
								that.user_id= res.data.user_id;
							}
						})
			        } else {
						console.log('登录失败！' + res.errMsg)
					}
			    }
			});
		},
		onShareAppMessage() {
		   return {
		         title: '您的朋友向您推荐数独play小程序',
		         path: 'pages/index/index', // 路径，传递参数到指定页面。
		　　　　  imgUrl: ''     //自定义图片路径，可以是本地文件路径、代码包文件路径或者网络图片路径，支 
		                          // 持PNG及JPG，不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
		    }
		},
		methods: {
			
		}
	}
</script>

<style>
	.indexcontent {
		width: 100%;
		min-height:100vh ;
		background-repeat: no-repeat;
		background-image: url('@/static/index/bag.png');
		background-size: 100% ;
		background-color: #f6f9f9;
	}

</style>
